from tkinter import*

print("Введите начальную координату X:")
X = int(input())
print("Введите начальную координату Y:")
Y = int(input())
print("Введите начальную координату N:")
N = int(input())

coo = [0,0,10,0,10,10,20,10,20,20, 10,20,10,30,0,30]
if N == 0 and X>=0 and X<=500 and Y>=0 and Y<=500:
    pass
else:
    if N > 0 and 0*N+X>=0 and 20*N+X<=500:
        pass
    else:
        if N < 0 and 20*N+X>=0 and 0*N+X>=0 and 0*N+Y<=500:
            pass
        print ("Размер фигуры превышает максимальный размер поля")
        exit()



root = Tk()

canvas = Canvas (bg="white" , width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)
canvas.create_polygon(coo[0] *N+X, coo[1] *N+Y,
                      coo[2] *N+X, coo[3] *N+Y,
                      coo[4] *N+Y, coo[5] *N+Y,
                      coo[6] *N+Y, coo[7] *N+Y,
                      coo[8] *N+Y, coo[9] *N+Y,
                      coo[10] *N+Y, coo[11] *N+Y,
                      coo[12] *N+Y, coo[13] *N+Y,
                      coo[14] *N+Y, coo[15] *N+Y)


root.mainloop()
